<html><head><title>OpenXMLDialog</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">OpenXMLDialog()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>OpenXMLDialog</b></font>(#Dialog, #XML, Name$ [, x, y [, Width, Height [, ParentID]]])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Open the specified dialog and display it on the screen. 
To access the dialog gadgets use <a href="dialoggadget.html">DialogGadget()</a>. To get the window number of this dialog use <a href="dialogwindow.html">DialogWindow()</a>. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Dialog</i></td>
<td width="90%"> 
The dialog to use. It has to be previously created with <a href="createdialog.html">CreateDialog()</a>. 

</td></tr>
<tr><td><i>#XML</i></td>
<td> 
The <a href="../xml/index.html">xml</a> to use. It has to be previously created with <a href="../xml/loadxml.html">LoadXML()</a>, <a href="../xml/createxml.html">CreateXML()</a> or <a href="../xml/catchxml.html">CatchXML()</a>. 
That means it's possible to create dialogs on the fly with <a href="../xml/createxml.html">CreateXML()</a> or <a href="../xml/catchxml.html">CatchXML()</a>. 
See below for the supported XML attributes. When including XML in the code, it may be easier to use single quote 
in XML for attribute (it's perfectly legal XML syntax). 

</td></tr>
<tr><td><i>Name$</i></td>
<td> 
The name of the dialog to open. An XML file can have several dialogs defined. 

</td></tr>
<tr><td><i>x, y (optional)</i></td>
<td> 
The x, y coordinate (in pixels) of the #Dialog. 

</td></tr>
<tr><td><i>Width, Height (optional)</i></td>
<td> 
The size (in pixels) of the #Dialog. If the size is smaller than the required size as defined in the XML (after layout 
calculation), then the required size will be used. If omitted, the size of the dialog will be the smallest size required. 

</td></tr>
<tr><td><i>ParentID (optional)</i></td>
<td> 
The parent window identifier. A valid window identifier can be retrieved with <a href="../window/windowid.html">WindowID()</a>. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero if the dialog has been successfully opened, returns zero otherwise. 
To get more information about the error which has occurred, use <a href="dialogerror.html">DialogError()</a>. 

</blockquote><p><b>Remarks</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">----------------------------------------------------------------
   Dialog XML format
----------------------------------------------------------------

  I. Common attributes
  --------------------

  width     - positive integer value or 0 (default=&quot;0&quot;) (set the &quot;minimum size&quot; of a control)
  height

  id        - #Number identifier for a gadget or a window (default is #PB_Any if not specified). It can be a runtime constant.
  name      - a string identifying the object (for <a href="dialoggadget.html">DialogGadget()</a> mainly, case insensitive) (default=&quot;&quot;)
  text      - text string for the object (default=&quot;&quot;)

  flags     - gadget/window flags in the form &quot;<font color="#924B72">#PB_Window_Borderless</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>&quot;  (default=&quot;&quot;)

  min        - minimum value
  max        - maximum value
  value      - current value

  invisible - if set to &quot;yes&quot;, creates the object invisible (default=&quot;no&quot;)
  disabled  - if &quot;yes&quot;, creates the object disabled (gadgets only) (default=&quot;no&quot;)

  colspan   - inside the &lt;gridbox&gt; element only, allows an element to span multiple rows/columns
  rowspan     (default=&quot;1&quot;)

  All these attributes are optional.


  II. Root element
  ----------------

  &lt;window&gt; for a single window definition in the same XML file
  &lt;/window&gt;
  
  or 
    
  &lt;dialogs&gt; for a multiple window definition in the same XML file
    &lt;window name=&quot;FirstWindow&quot;&gt;
    &lt;/window&gt;
    &lt;window name=&quot;SecondWindow&quot;&gt;
    &lt;/window&gt;
    ...
  &lt;/dialogs&gt;


  III. Window element
  -------------------

  &lt;window&gt;
  &lt;/window&gt;
  
  Accepted keys in the XML: 
  All common attributes and the following:
  
  minwidth  = 'auto' or a numeric value
  maxwidth  = 'auto' or a numeric value
  minheight = 'auto' or a numeric value
  maxheight = 'auto' or a numeric value
  
  It allows to set the window bounds. If set to 'auto', then the
  size is calculated depending of the children size requirement.
  

  - Creates the a window
  - Can have all common attributes.
  - Is a single-element container.
  - If more than one &lt;window&gt; element is present, the 'name' attribute is used to identify them
  - all gui elements can only be placed in here
  
  
  IV. Layout elements
  -------------------
  
  *****************************************************************
  hbox and vbox
  *****************************************************************

    Arrange the elements horizontally or vertically. Can contain
    any number of children.

    Accepted keys in the XML: 
    All common attributes and the following:
  
    spacing   = space to add between the packed childs (default=5)
  
    expand    = yes           - items get bigger to fill all space (default)
                no            - do not expand to fill all space 
                equal         - force equal sized items
                item:&lt;number&gt; - expand only one item if space is available
  
    align     = top/left      - only applied when expand=&quot;no&quot;, top/left is the default
                center
                bottom/right

  *****************************************************************
  gridbox 
  *****************************************************************
  
    Align elements in a table. Can contain
    any number of children.
    
    Accepted keys in the XML:
    All common attributes and the following:
  
    columns = number of columns (default = 2)
  
    colspacing = space to add between columns/rows (default = 5)
    rowspacing
  
    colexpand = yes           - items get bigger to fill all space
    rowexpand   no            - do not expand to fill all space
                equal         - force equal sized items
                item:&lt;number&gt; - expand only one item if space is available
  
                for colexpand, Default=yes, For rowexpand, Default=no
  
    Any child within a gridbox can have these keys:
  
    colspan = number of columns to span (default = 1)
    rowspan = number of rows to span
  
  *****************************************************************
  multibox
  *****************************************************************
   
    A box with multiple childs in the same position. Used to put multiple containers
    inside and show only one of them at a time. Can contain
    any number of children.
   
    Accepted keys in the XML:

    All common attributes.
    
  *****************************************************************
  singlebox
  *****************************************************************
   
    A box with just one child. Used only to apply extra margin/alignment properties to a child.
    Its called a box (as all virtual containers are called that).

    Accepted keys in the XML:
    
    All common attributes and the following:
  
    margin = margin around the content (default = 10)
             can be a single number (= all margin), or a combination of
             top:&lt;num&gt;,left:&lt;num&gt;,right:&lt;num&gt;,bottom:&lt;num&gt;,vertical:&lt;num&gt;,horizontal:&lt;num&gt;
             example: &quot;vertical:5,left:10,right:0&quot;
  
    expand = yes        - expand child to fill all space (default)
             no         - no expanding
             vertical   - expand vertically only
             horizontal - expand horizontally only
  
    expandwidth  = max size to expand the children to. If the requested size is larger than
    expandheight   this setting then the request size is used (ie the content does not get smaller)
                   default=0
  
    align  = combination of top,left,bottom,right and center. (only effective when expand &lt;&gt; yes)
             example: &quot;top, center&quot; or &quot;top, left&quot; (default) 
             
             
             
  V. Gadget elements
  ------------------

  All common XML attributes are supported. To bind an event procedure directly in the xml, the following attributes
  are available for the gadgets:
  
    onevent      = EventProcedure() - generic event binding, for all event type
    onchange     = EventProcedure() - #PB_EventType_Change binding (only for gadget which support this event type)
    onfocus      = EventProcedure() - #PB_EventType_Focus binding (only for gadget which support this event type)
    onlostfocus  = EventProcedure() - #PB_EventType_LostFocus binding (only for gadget which support this event type)
    ondragstart  = EventProcedure() - #PB_EventType_DragStart binding (only for gadget which support this event type)
    onrightclick = EventProcedure() - #PB_EventType_RightClick binding (only for gadget which support this event type)
    onleftclick  = EventProcedure() - #PB_EventType_LeftClick binding (only for gadget which support this event type)
    onrightdoubleclick = EventProcedure() - #PB_EventType_RightDoubleClick binding (only for gadget which support this event type)
    onleftdoubleclick  = EventProcedure() - #PB_EventType_LeftDoubleClick binding (only for gadget which support this event type)
    
  The 'EventProcedure()' has to be declared as 'Runtime' in the main code, and has to respect the BindEvent() procedure
  format. Under the hood, BindGadgetEvent() is called with the specified procedure.
  
  Supported gadgets:

  &lt;button&gt;
  &lt;buttonimage&gt;
  &lt;calendar&gt;
  &lt;canvas&gt;
  &lt;checkbox&gt;
  &lt;combobox&gt;
  &lt;container&gt; - single element container
  &lt;date&gt;
  &lt;editor&gt;
  &lt;explorercombo&gt;
  &lt;explorerlist&gt;
  &lt;explorertree&gt; 
  &lt;frame&gt; - single element container
  &lt;hyperlink&gt;
  &lt;ipaddress&gt;
  &lt;image&gt;
  &lt;listicon&gt; 
  &lt;listview&gt;
  &lt;option group&gt; - use the same 'group' number to create linked <a href="../gadget/optiongadget.html">OptionGadget()</a>.
  &lt;panel&gt; - can contain &lt;tab&gt; items only
  &lt;progressbar min max value&gt; 
  &lt;scrollarea scrolling=&quot;vertical,horizontal or both (default)&quot; innerheight innerwidth step&gt; - single element container, scrolling value determines growth behavior
  &lt;scrollbar min max page value&gt; - page = page length
  &lt;spin min max value&gt;
  &lt;splitter firstmin=&quot;value or auto&quot; secondmin&gt; - must contain 2 subitems, so its a 2 item container basically, minimum size is determined by contained gadgets. If &quot;auto&quot; is specified, the min value will be the minimum size of the child.
  &lt;string&gt;
  &lt;text&gt;
  &lt;trackbar min max value&gt;
  &lt;tree&gt;
  &lt;web&gt;
  &lt;scintilla&gt; - callback remains empty

  Gadget related elements:
  &lt;tab&gt; - single element container, for panel tabs (attribute 'text' is supported).
  
  Special elements:
  &lt;empty&gt; - an empty element, useful when it's needed to have space between element, to align them to borders for example. 

</font></pre>

</blockquote><p><b>Example:</b> Simple resizable dialog</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; As we embedded xml directly in the source, the encoding of special characters will vary if we are in unicode mode or not. </font>
  <font color="#3A3966">; So ensure to use the correct one. This is not needed if the XML is read from an external file or directly included</font>
  <font color="#3A3966">; with IncludeBinary.</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">CompilerIf</font></b> <font color="#924B72">#PB_Compiler_Unicode</font>
    <font color="#924B72">#XmlEncoding</font> = <font color="#924B72">#PB_UTF8</font>
  <b><font color="#3A3966">CompilerElse</font></b> 
    <font color="#924B72">#XmlEncoding</font> = <font color="#924B72">#PB_Ascii</font>
  <b><font color="#3A3966">CompilerEndIf</font></b>

  <font color="#924B72">#Dialog</font> = 0
  <font color="#924B72">#Xml</font> = 0
  
  XML$ = &quot;&lt;window id='#PB_Any' name='test' text='test' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'&gt;&quot; +
         &quot;  &lt;panel&gt;&quot; +
         &quot;    &lt;tab text='First tab'&gt;&quot; +
         &quot;      &lt;vbox expand='item:2'&gt;&quot; +
         &quot;        &lt;hbox&gt;&quot; +
         &quot;          &lt;button text='button 1'/&gt;&quot; +
         &quot;          &lt;checkbox text='checkbox 1'/&gt;&quot; +
         &quot;          &lt;button text='button 2'/&gt;&quot; +
         &quot;        &lt;/hbox&gt;&quot; +
         &quot;        &lt;editor text='content' height='150'/&gt;&quot; +
         &quot;      &lt;/vbox&gt;&quot; +
         &quot;    &lt;/tab&gt;&quot; +
         &quot;    &lt;tab text='Second tab'&gt;&quot; +
         &quot;    &lt;/tab&gt;&quot; +
         &quot;  &lt;/panel&gt;&quot; +
         &quot;&lt;/window&gt;&quot;
  
  <b><font color="#3A3966">If</font></b> <font color="#3A3966">CatchXML</font>(<font color="#924B72">#Xml</font>, @XML$,<font color="#3A3966"> StringByteLength</font>(XML$), 0, <font color="#924B72">#XmlEncoding</font>) <b><font color="#3A3966">And</font></b> <font color="#3A3966">XMLStatus</font>(<font color="#924B72">#Xml</font>) = <font color="#924B72">#PB_XML_Success</font>
    
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateDialog</font>(<font color="#924B72">#Dialog</font>) <b><font color="#3A3966">And</font></b> <font color="#3A3966">OpenXMLDialog</font>(<font color="#924B72">#Dialog</font>, <font color="#924B72">#Xml</font>, &quot;test&quot;)
      
      <b><font color="#3A3966">Repeat</font></b>
        Event =<font color="#3A3966"> WaitWindowEvent</font>()
      <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font> 
      
    <b><font color="#3A3966">Else</font></b>  
      <b><font color="#3A3966">Debug</font></b> &quot;Dialog error: &quot; +<font color="#3A3966"> DialogError</font>(<font color="#924B72">#Dialog</font>)
    <b><font color="#3A3966">EndIf</font></b>
  <b><font color="#3A3966">Else</font></b>
    <b><font color="#3A3966">Debug</font></b> &quot;XML error: &quot; +<font color="#3A3966"> XMLError</font>(<font color="#924B72">#Xml</font>) + &quot; (Line: &quot; +<font color="#3A3966"> XMLErrorLine</font>(<font color="#924B72">#Xml</font>) + &quot;)&quot;
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>Example:</b> Multibox example</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; As we embedded xml directly in the source, the encoding of special characters will vary if we are in unicode mode or not. </font>
  <font color="#3A3966">; So ensure to use the correct one. This is not needed if the XML is read from an external file or directly included</font>
  <font color="#3A3966">; with IncludeBinary.</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">CompilerIf</font></b> <font color="#924B72">#PB_Compiler_Unicode</font>
    <font color="#924B72">#XmlEncoding</font> = <font color="#924B72">#PB_UTF8</font>
  <b><font color="#3A3966">CompilerElse</font></b> 
    <font color="#924B72">#XmlEncoding</font> = <font color="#924B72">#PB_Ascii</font>
  <b><font color="#3A3966">CompilerEndIf</font></b>

  <font color="#924B72">#Dialog</font> = 0
  <font color="#924B72">#Xml</font> = 0
  
  <b><font color="#3A3966">Runtime</font></b> <b><font color="#3A3966">Enumeration</font></b> Gadget
    <font color="#924B72">#ListView</font>
    <font color="#924B72">#GeneralContainer</font>
    <font color="#924B72">#EditorContainer</font>
    <font color="#924B72">#BackupContainer</font>
  <b><font color="#3A3966">EndEnumeration</font></b>
  
  <b><font color="#3A3966">Procedure</font></b> <font color="#3A3966">ShowPanels</font>()
    
<font color="#3A3966">    HideGadget</font>(<font color="#924B72">#GeneralContainer</font>, <font color="#924B72">#True</font>)
<font color="#3A3966">    HideGadget</font>(<font color="#924B72">#EditorContainer</font>, <font color="#924B72">#True</font>) 
<font color="#3A3966">    HideGadget</font>(<font color="#924B72">#BackupContainer</font>, <font color="#924B72">#True</font>)
    
    <b><font color="#3A3966">Select</font></b> <font color="#3A3966">GetGadgetState</font>(<font color="#924B72">#ListView</font>)
      <b><font color="#3A3966">Case</font></b> 0
<font color="#3A3966">        HideGadget</font>(<font color="#924B72">#GeneralContainer</font>, <font color="#924B72">#False</font>)
        
      <b><font color="#3A3966">Case</font></b> 1
<font color="#3A3966">        HideGadget</font>(<font color="#924B72">#EditorContainer</font>, <font color="#924B72">#False</font>)
        
      <b><font color="#3A3966">Case</font></b> 2
<font color="#3A3966">        HideGadget</font>(<font color="#924B72">#BackupContainer</font>, <font color="#924B72">#False</font>)
    <b><font color="#3A3966">EndSelect</font></b>
  <b><font color="#3A3966">EndProcedure</font></b>
  
  <b><font color="#3A3966">Runtime</font></b> <b><font color="#3A3966">Procedure</font></b> <font color="#3A3966">OnListViewEvent</font>()
<font color="#3A3966">    ShowPanels</font>()
  <b><font color="#3A3966">EndProcedure</font></b>
  
  XML$ = &quot;&lt;window id='#PB_Any' name='test' text='Preferences' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'&gt;&quot; +
         &quot;  &lt;hbox expand='item:2'&gt;&quot; +
         &quot;    &lt;listview id='#ListView' width='100' onEvent='OnListViewEvent()'/&gt;&quot; +
         &quot;    &lt;multibox&gt;&quot; +
         &quot;&quot; +
         &quot;      &lt;container id='#GeneralContainer' invisible='yes'&gt;&quot; +
         &quot;        &lt;frame text='General'&gt;&quot; +
         &quot;          &lt;vbox expand='no'&gt;&quot; +
         &quot;            &lt;checkbox text='Enable red light'/&gt;&quot; +
         &quot;            &lt;checkbox text='Enable green light'/&gt;&quot; +
         &quot;          &lt;/vbox&gt;&quot; +
         &quot;        &lt;/frame&gt;&quot; +
         &quot;      &lt;/container&gt;&quot; +
         &quot;&quot; +
         &quot;      &lt;container id='#EditorContainer' invisible='yes'&gt;&quot; +
         &quot;        &lt;frame text='Editor'&gt;&quot; +
         &quot;          &lt;vbox expand='no'&gt;&quot; +
         &quot;            &lt;checkbox text='Set read only mode'/&gt;&quot; +
         &quot;            &lt;checkbox text='Duplicate line automatically'/&gt;&quot; +
         &quot;            &lt;checkbox text='Enable monospace font'/&gt;&quot; +
         &quot;          &lt;/vbox&gt;&quot; +
         &quot;        &lt;/frame&gt;&quot; +
         &quot;      &lt;/container&gt;&quot; +
         &quot;&quot; +
         &quot;      &lt;container  id='#BackupContainer' invisible='yes'&gt;&quot; +
         &quot;      &lt;frame text='Backup'&gt;&quot; +
         &quot;        &lt;vbox expand='no'&gt;&quot; +
         &quot;          &lt;checkbox text='Activate backup'/&gt;&quot; +
         &quot;        &lt;/vbox&gt;&quot; +
         &quot;      &lt;/frame&gt;&quot; +
         &quot;      &lt;/container&gt;&quot; +
         &quot;&quot; +
         &quot;    &lt;/multibox&gt;&quot; +
         &quot;  &lt;/hbox&gt;&quot; +
         &quot;&lt;/window&gt;&quot;
  
  <b><font color="#3A3966">If</font></b> <font color="#3A3966">CatchXML</font>(<font color="#924B72">#Xml</font>, @XML$,<font color="#3A3966"> StringByteLength</font>(XML$), 0, <font color="#924B72">#XmlEncoding</font>) <b><font color="#3A3966">And</font></b> <font color="#3A3966">XMLStatus</font>(<font color="#924B72">#Xml</font>) = <font color="#924B72">#PB_XML_Success</font>
    
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateDialog</font>(<font color="#924B72">#Dialog</font>) <b><font color="#3A3966">And</font></b> <font color="#3A3966">OpenXMLDialog</font>(<font color="#924B72">#Dialog</font>, <font color="#924B72">#Xml</font>, &quot;test&quot;)
      
<font color="#3A3966">      AddGadgetItem</font>(<font color="#924B72">#ListView</font>, -1, &quot;General&quot;)
<font color="#3A3966">      AddGadgetItem</font>(<font color="#924B72">#ListView</font>, -1, &quot;Editor&quot;)
<font color="#3A3966">      AddGadgetItem</font>(<font color="#924B72">#ListView</font>, -1, &quot;Backup&quot;)
      
<font color="#3A3966">      SetGadgetState</font>(<font color="#924B72">#ListView</font>, 0)
      
<font color="#3A3966">      ShowPanels</font>()
      
      <b><font color="#3A3966">Repeat</font></b>
        Event =<font color="#3A3966"> WaitWindowEvent</font>()
      <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font> 
      
    <b><font color="#3A3966">Else</font></b>  
      <b><font color="#3A3966">Debug</font></b> &quot;Dialog error: &quot; +<font color="#3A3966"> DialogError</font>(<font color="#924B72">#Dialog</font>)
    <b><font color="#3A3966">EndIf</font></b>
  <b><font color="#3A3966">Else</font></b>
    <b><font color="#3A3966">Debug</font></b> &quot;XML error: &quot; +<font color="#3A3966"> XMLError</font>(<font color="#924B72">#Xml</font>) + &quot; (Line: &quot; +<font color="#3A3966"> XMLErrorLine</font>(<font color="#924B72">#Xml</font>) + &quot;)&quot;
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>Example:</b> Gridbox example</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; As we embedded xml directly in the source, the encoding of special characters will vary if we are in unicode mode or not. </font>
  <font color="#3A3966">; So ensure to use the correct one. This is not needed if the XML is read from an external file or directly included</font>
  <font color="#3A3966">; with IncludeBinary.</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">CompilerIf</font></b> <font color="#924B72">#PB_Compiler_Unicode</font>
    <font color="#924B72">#XmlEncoding</font> = <font color="#924B72">#PB_UTF8</font>
  <b><font color="#3A3966">CompilerElse</font></b> 
    <font color="#924B72">#XmlEncoding</font> = <font color="#924B72">#PB_Ascii</font>
  <b><font color="#3A3966">CompilerEndIf</font></b>
  
  <font color="#924B72">#Dialog</font> = 0
  <font color="#924B72">#Xml</font> = 0
  
  XML$ = &quot;&lt;window id='#PB_Any' name='test' text='Gridbox' minwidth='auto' minheight='auto' flags='#PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget'&gt;&quot; +
         &quot;    &lt;gridbox columns='6'&gt;&quot; +
         &quot;          &lt;button text='Button 1' /&gt;&quot; +
         &quot;          &lt;button text='Button 2' /&gt;&quot; +
         &quot;          &lt;button text='Button 3' colspan='3' /&gt;&quot; +
         &quot;          &lt;button text='Button 4' /&gt;&quot; +
         &quot;          &lt;button text='Button 5' rowspan='2' /&gt;&quot; +
         &quot;          &lt;button text='Button 6' /&gt;&quot; +
         &quot;          &lt;button text='Button 7' /&gt;&quot; +
         &quot;          &lt;button text='Button 8' /&gt;&quot; +
         &quot;          &lt;button text='Button 9' /&gt;&quot; +
         &quot;          &lt;button text='Button 10' /&gt;&quot; +
         &quot;          &lt;button text='Button 11' /&gt;&quot; +
         &quot;          &lt;button text='Button 12' /&gt;&quot; +
         &quot;    &lt;/gridbox&gt;&quot; +
         &quot;  &lt;/window&gt;&quot;
  
  <b><font color="#3A3966">If</font></b> <font color="#3A3966">CatchXML</font>(<font color="#924B72">#Xml</font>, @XML$,<font color="#3A3966"> StringByteLength</font>(XML$), 0, <font color="#924B72">#XmlEncoding</font>) <b><font color="#3A3966">And</font></b> <font color="#3A3966">XMLStatus</font>(<font color="#924B72">#Xml</font>) = <font color="#924B72">#PB_XML_Success</font>
    
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateDialog</font>(<font color="#924B72">#Dialog</font>) <b><font color="#3A3966">And</font></b> <font color="#3A3966">OpenXMLDialog</font>(<font color="#924B72">#Dialog</font>, <font color="#924B72">#Xml</font>, &quot;test&quot;)
      
      <b><font color="#3A3966">Repeat</font></b>
        Event =<font color="#3A3966"> WaitWindowEvent</font>()
      <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font> 
      
    <b><font color="#3A3966">Else</font></b>  
      <b><font color="#3A3966">Debug</font></b> &quot;Dialog error: &quot; +<font color="#3A3966"> DialogError</font>(<font color="#924B72">#Dialog</font>)
    <b><font color="#3A3966">EndIf</font></b>
  <b><font color="#3A3966">Else</font></b>
    <b><font color="#3A3966">Debug</font></b> &quot;XML error: &quot; +<font color="#3A3966"> XMLError</font>(<font color="#924B72">#Xml</font>) + &quot; (Line: &quot; +<font color="#3A3966"> XMLErrorLine</font>(<font color="#924B72">#Xml</font>) + &quot;)&quot;
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="createdialog.html">CreateDialog()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=isdialog.html>IsDialog()</a> - <a href="index.html">Dialog Index</a> - <a href="refreshdialog.html">RefreshDialog()</a> -><br><br>

</body></html>